package org.jxf.gps.jt808.message;

import org.apache.log4j.Logger;
import org.jxf.gps.jt808.server.ServerHandler;

import com.jfinal.kit.PropKit;



/**
 * 终端鉴权处理
 * @author jxf
 * 2015年10月21日
 */
public class MsgBodyHandle0102 extends MsgBodyHandle {
	private static Logger logger = Logger.getLogger(MsgBodyHandle0102.class);

	@Override
	public Message genResp() {
		return super.genResp();
	}

	@Override
	public boolean doMsg(Message moMsg) {
		super.doMsg(moMsg);		
		String msg0102_auth = PropKit.get("msg0102_auth");
		if ("0".equalsIgnoreCase(msg0102_auth)) {
			return true;
		}
		

		Msg0102 msg = (Msg0102) moMsg.mBody;
		if ("1234567890A".equals(msg.key)){
			return true;
		}else{
			logger.info("鉴权不过 : " + moMsg.mdn + " , "+ msg.key);
			return false;
		}
	}
	
	

	
}
